<?php
if (!defined("IN_OP"))
{
    exit("You can't access this file directly...");
}
$gametype = intval(getvar("gametype"));
$gType = chkGametype($gametype);
switch ($gType)
{
    case 0 :
        $ui = new UI();
        break;
    default :
        include_once( "class_3d/CheckMode_3d.php" );
        $chk = new CheckMode_3d($curruser['acl'], 1, $gametype);
        $chk->checkShow3dPage();
        unset($chk);
        break;
}
@ob_clean();
header("Cache-Control: no-cache, must-revalidate");
header("Content-Type: text/plain");
$id = intval(getvar("id"));
if ($id < 1)
{
    echo "{\"state\":\"-1\"}";
    exit();
}
$rs9 = false;
if ($curruser['acl'] < 255)
{
    $users9 = getuserlist($curruser['id'], 2);
    $userArrTemp = explode(",", $users9);
    if (!in_array($id, $userArrTemp))
    {
        echo "{\"state\":\"-2\"}";
        exit();
    }
}
$sql = "SELECT id, account FROM k_user WHERE acl = 1 AND prev_id = {$id} and enabled = 1 ORDER BY account";
$rs = getdb($sql);
$tempArrID = array();
$tempArrAccount = array();
while (!$rs->eof)
{
    $tempArrID[] = $rs->f['id'];
    $tempArrAccount[] = $rs->f['account'];
    $rs->next();
}
echo "{";
echo "\"state\":1";
echo ", \"idArr\":[\"" . implode("\",\"", $tempArrID) . "\"]";
echo ", \"accArr\":[\"" . implode("\",\"", $tempArrAccount) . "\"]";
echo "}";
exit();
?>